package com.crm.business.crm.service;

import com.crm.common.crm.common.CrmModel;
import com.crm.common.crm.entity.BO.CrmRoiSearchBO;
import com.crm.common.crm.entity.BO.CrmUpdateInformationBO;
import com.crm.common.crm.entity.PO.CrmPutinStatistics;
import com.crm.common.ka.core.entity.BasePage;
import com.crm.business.servlet.BaseService;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

public interface ICrmPutinStatisticsService extends BaseService<CrmPutinStatistics> {
    /**
     * 查询字段配置
     *
     * @param id 主键ID
     * @return data
     */
    public CrmModel queryById(Integer id);

    /**
     * 删除投放金额数据
     *
     * @param ids ids
     */
    public void deleteByIds(List<Integer> ids);

    /**
     * 分页查询
     *
     * @param search
     * @return
     */
    public BasePage<CrmPutinStatistics> queryPageList(@RequestBody CrmRoiSearchBO search);


    public List<CrmPutinStatistics> queryNewList(@RequestBody CrmPutinStatistics crmPutinStatistics);

    /**
     * 保存或新增信息
     *
     * @param crmPutinStatistics model
     */
    public void addOrUpdate(CrmPutinStatistics crmPutinStatistics);

    void updateInformation(CrmUpdateInformationBO updateInformationBO);

    /**
     * 根据投放平台与表单录入时间查询投放统计数据
     * @param putinPlatform 投放平台
     * @param putinFormDate 表单录入时间
     * @return 投放统计数据集合
     */
    public CrmPutinStatistics queryStatisticsByPlatformAndPutinDormData(String putinPlatform, Date putinFormDate);
    public CrmPutinStatistics queryStatisticsByPlatformAndPutinDormData(String putinPlatform, String putinFormDate);

    /**
     * ROI统计
     */
    public void roiSatistics();


    /**
     * 导出
     *
     * @param response resp
     * @param search   搜索对象
     */
    public void exportExcel(HttpServletResponse response, CrmRoiSearchBO search);

    /**
     * 查询投放平台
     *
     */
    public List<String> querySource();


}
